import { Module } from '@nestjs/common';
import { JwtModule } from '@nestjs/jwt'
import {TypeOrmModule} from '@nestjs/typeorm'
import { AuthService } from './auth.service';
import { JWT_EXPIRES, JWT_SECRET } from './constants'
import { AuthController } from './auth.controller';
import { User } from 'src/entities/user.entity';


@Module({
  imports: [
    TypeOrmModule.forFeature([User]),
    JwtModule.register({
    secret: JWT_SECRET,
    signOptions: { expiresIn: JWT_EXPIRES },
  })],
  providers: [AuthService],
  exports: [AuthService],
  controllers: [AuthController]
})
export class AuthModule { }
